package com.atguigu.spzx.manager.service.impl;

import com.atguigu.spzx.manager.mapper.OrderFormMapper;
import com.atguigu.spzx.manager.service.OrderFormService;
import com.atguigu.spzx.model.entity.system.SysUser;
import com.atguigu.spzx.model.vo.order.OrderVo;
import com.atguigu.spzx.utils.AuthContextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderFormServiceImpl implements OrderFormService {

    @Autowired
    private OrderFormMapper orderFormMapper;

    @Override
    public List<OrderVo> GetAllOrder() {
        SysUser sysUser = AuthContextUtil.get();
        Long id = sysUser.getId();

        List<OrderVo> list = orderFormMapper.getAllOrder(id);
        return list;
    }

    @Override
    public void DeleteOrder(Long id) {
        orderFormMapper.deleteOrder(id);
    }
}
